/**
 * @fileOverview Description
 * @author Le Duc, Nam (lenam.k54@gmail.com)
 * @copyright VIT Coder group
 */

'use strict';

var express = require('express');
var home = require('./routes/home');
var app = express();

/**
 * Add template engine
 */
app.engine('ejs', require('ejs').__express);

/**
 * @description Set static path for express
 */
app.set('views', './views');
/**
 * @description Set default view engine
 */
app.set('view engine', 'ejs');
/**
 * @description Set static folder for client
 */
app.use(express.static(__dirname + '/public'));



/**
 * Handle action when user request to rootsite
 * @param {Request} req Request from user
 * @param {Response} res Response obj handle respond to user result
 */
app.get('/', home.index);

/**
 * Start server
 */
var server = app.listen(3000, function () {
    console.log('Listening on port %d', server.address().port);
});
